package com.bwie.controller;

import com.bwie.pojo.TbCar;
import com.bwie.service.TbCarService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/car/index")
public class CarController {
    @Autowired
    private TbCarService tbCarService;
   /**
    * 车辆入场
   */
    @PostMapping("/inCome")
    public R inCome(@RequestBody TbCar tbCar){
        return tbCarService.inCome(tbCar);
    }
    /**
     *停车列表
     */
    @PostMapping("/getCarList")
    public R getCarList(@RequestBody PageInfoVo pageInfoVo){
        return tbCarService.getCarList(pageInfoVo);
    }
    /**
     *
     * 车辆离场
     */
    @PostMapping("/outParking")
    public R outParking(@RequestBody TbCar tbCar){
        return R.OK(tbCarService.removeById(tbCar.getCarId()));
    }
}
